<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/5/31
 * Time: 15:24
 */

namespace app\store\validate;

use think\Validate;

class StoreValidate extends Validate
{
    protected $rule = [
        'store_name' => 'require',
        'user_id' => 'require',
        'province_id' => 'require',
        'city_id' => 'require',
        'district_id' => 'require',
        'address' => 'require',
        'lng' => 'require',
        'lat' => 'require',
        'store_content' => 'require',
        'more.thumbnail' => 'require',
        'maid' => 'number|between:0,1',
        'rec_maid' => 'number|between:0,1'
    ];
    protected $message = [
        'store_name.require' => '店铺名称不能为空！',
        'user_id.require' => '店铺绑定用户不能为空！',
        'province_id.require' => '店铺所在省不能为空！',
        'city_id.require' => '店铺所在市不能为空！',
        'district_id.require' => '店铺所在区不能为空！',
        'address.require' => '店铺详细地址不能为空！',
        'lng.require' => '店铺经度不能为空！',
        'lat.require' => '店铺纬度不能为空！',
        'store_content.require' => '店铺介绍不能为空！',
        'more.thumbnail.require' => '店铺头像不能为空！',
        'maid.number' => '返佣必须为数字！范围0%-100%',
        'rec_maid.number' => '推荐返佣必须为数字！范围0%-100%',
    ];

}